package com.zhongxiangspace.mapper;


import com.zhongxiangspace.entity.County;
import com.zhongxiangspace.entity.QueryAnalyzer;
import com.zhongxiangspace.entity.VO.TradeAreaVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 区县
 */
public interface CountyMapper {


    /**
     * 插入
     * @param county
     * @return
     */
    boolean insert(County county);

    /**
     * 根据keyword 获取data
     * @param queryAnalyzer
     * @return
     */
    List<County> queryByKeyword(QueryAnalyzer queryAnalyzer);

    /**
     * 逻辑删除
     * @param id
     * @return
     */
    boolean delete(@Param("id") Integer id);

    /**
     * 更新状态
     * @param county
     * @return
     */
    boolean updataStatusCode(County county);

    /**
     * 获取单条data
     * @param id
     * @return
     */
    County queryOne(@Param("id")Integer id);

    /**
     * 更新data
     * @param county
     * @return
     */
    boolean updata(County county);

    /**
     * 设置商圈热门和非热门
     * @param county
     * @return
     */
    boolean updataHotCode(County county);

    /**
     *
     * @param parent_id 父亲id
     * @return
     */
    List<County> queryAllType(@Param("parent_id") Integer parent_id);

    /**
     *根据父类id data
     * @param queryAnalyzer 条件
     * @return
     */
    List<Map<String,Object>> queryTradeAreaByKeyword(QueryAnalyzer queryAnalyzer);

    /**
     * 条件
     * @param tradeAreaQueryAnalyzer
     * @return
     */
    List<TradeAreaVO> queryTradeAreaVO(QueryAnalyzer tradeAreaQueryAnalyzer);

    /**
     * 获取商圈下房源数量
     * @return
     */
    List<Map<String,Object>> queryCountyByhouseNum();
}
